package com.thread.threadfirst.marvel.citymaster.enums;
import lombok.Getter;


/**
 *  1 报名 2 当选 3 没当选 4 下台  5 退出争夺
 */
@Getter
public enum ApplyCityStatus {

    CS1(1, "报名"),
    CS2(2, "当选"),
    CS3(3, "没当选"),
    CS4(4, "下台"),
    CS5(5, "退出争夺");

    private final String description;
    private final Integer value;

    ApplyCityStatus(int value, String description) {
        this.value = value;
        this.description = description;
    }

    /**
     * 根据key获取枚举
     *
     * @param key
     * @return
     */
    public static ApplyCityStatus getEnumByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (ApplyCityStatus temp : ApplyCityStatus.values()) {
            if (temp.value.equals(key)) {
                return temp;
            }
        }
        return null;
    }





}
